import React, { Component } from 'react';
import { wxShare } from '../../utils/weixinShare';
import {
    Flex,
    Icon,
    Modal,
    Carousel,
    WingBlank,
    WhiteSpace,
    Toast,
    SwipeAction,
    Popover
} from 'antd-mobile';

import Moment from 'moment';
import NoLazyImg from '../../components/NoLazyImg/NoLazyImg';

import fenxiaoShare from '../../assets/svg/fenxiaoShare.svg';
import {evalute_madel} from "../evaluate/EvaluateListItem.less";

import { routerRedux } from 'dva/router';
import {IMAGE_DOMAIN, isWechat} from "../../utils/common";


class ShopOpenGroupItem extends Component {
    constructor(props){
        super(props);
        this.state={

        };

    }

    render () {
        const { v, dispatch ,my} = this.props;
        return (
            <div    style={{background:"#fff",padding:".2rem"}} >
                    <Flex className="goods_list_item">
                        <div className="goods_img" onClick={()=>{ dispatch(routerRedux.push(`/goodsDetail/${v.specId}`));return false; }}>
                            <NoLazyImg src={ v.goodsImage?v.goodsImage :""  } />
                        </div>
                        <Flex className="goods_content" justify="between" >
                            <Flex direction="column" style={{width:"100%"}} onClick={()=>{ dispatch(routerRedux.push(`/goodsDetail/${v.specId}`));return false; }}>
                                <div className="name text-two-eli"  >{ v.goodsName  }</div>
                                <Flex style={{width:"100%"}} align="end">
                                    {v.storeId==0?<div style={{border:"1px solid #F17878",color:"#F17878",padding:".05rem",borderRadius:".1rem",marginRight:".2rem"}}>自营</div>:""}
                                    <div className="price" >￥<span style={{fontSize:".4rem"}}>{ v.groupPrice  }</span></div>
                                    <div className="groupPrice">原价:¥{v.goodsPrice }</div>
                                </Flex>
                               <Flex justify="between" style={{width:"100%",marginTop:".2rem"}}>
                                   <div>
                                       <div style={{color:"#999"}}>已团{v.saleNum>=10000?v.saleNum/10000+"万":v.saleNum }件</div>
                                       <div className="lisheng">立省¥{v.priceDifference }</div>
                                   </div>
                                   <div className="jiaruxiaodian" onClick={(e)=>{
                                       dispatch(routerRedux.push(`/goodsDetail/${v.specId}`));
                                   }
                                   }>去拼团</div>
                               </Flex>
                            </Flex>
                        </Flex>

                    </Flex>
            </div>
        );
    }
}

export default ShopOpenGroupItem;
